package cn.edu.nwpu.warehousemanagement.pojo;

import cn.edu.nwpu.warehousemanagement.constantEnum.ShelfStatus;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;


/**
 * 货架 save有问题 todo
 *
 * @author Loadstar
 * @version 1.0
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "shelf")
public class Shelf extends BaseEntity {


    @Column(name = "name", nullable = false, length = 100)
    private String name;

    @Column(name = "location", nullable = false, length = 100)
    private String location;

    @Column(name = "capacity",nullable = false)
    private Long capacity;

    @Enumerated(EnumType.STRING)
    @Column(name = "status", length = 20, columnDefinition = "VARCHAR(20) DEFAULT 'Normal'")
    private ShelfStatus shelfStatus;

    public Shelf(long id) {
        this.setId(id);
    }
}
